﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Web.Configuration;

namespace OnlineBusTicket.Phucnh
{
    public partial class PersonalInformation : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack == false)
            {
                string userName = HttpContext.Current.User.Identity.Name;
                SqlConnection con = new SqlConnection(WebConfigurationManager.ConnectionStrings["ApplicationServices"].ToString());
                con.Open(); //neu can userid thi them dbo.aspnet_Users.UserId vao query sau select
                SqlDataAdapter da = new SqlDataAdapter("SELECT     dbo.aspnet_Users.UserName, dbo.Member.FullName, dbo.Member.Age, dbo.Member.Gender, dbo.Member.Address, dbo.Member.Phone FROM         dbo.aspnet_Users INNER JOIN                      dbo.Member ON dbo.aspnet_Users.UserName = dbo.Member.UserName where Member.UserName='" + userName + "' ", con);
                DataSet ds = new DataSet();
                da.Fill(ds);
                GridView1.DataSource = ds;
                GridView1.DataBind();
                
            }
        }

        protected void btnUpdateInfor(object sender, EventArgs e)
        {
            Response.Redirect("UpdatePersonInfor.aspx");
        }

        
        //    
        

       // protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
       // { //neu dung userid cho trang sau
            //Session["UserId"] = GridView1.SelectedRow.Cells[1].Text;
       // }
    }
}